@extends('admin.page')
@section('body')
    @if($customers)
        @foreach($customers as $customer)
            <div style="padding: 20px;">
                <table class="layui-table" lay-size="sm">
                    <tr>
                        <th>姓名</th>
                        <th>年龄</th>
                        <th>登记时间</th>
                        <th>预约状态</th>
                        <th>咨询</th>
                    </tr>
                    <tr>
                        <td>{{$customer['name']}}</td>
                        <td>{{$customer['age']}}</td>
                        <td>{{$customer['created_at']}}</td>
                        <td>{{$customer['status_text']}}</td>
                        <td>{{$customer['custom_service_name']}}</td>
                    </tr>
                    @if(!empty($customer['visit_data']))
                        <tr>
                            <th colspan="10">回访记录</th>
                        </tr>
                        @foreach($customer['visit_data'] as $visit)
                            <tr>
                                <td colspan="10">{{$visit['created_at']}} {{$visit['content']}}【{{$visit['user_name']}}】
                                </td>
                            </tr>
                        @endforeach
                    @endif

                    <tr>
                        <th colspan="10">商务通记录</th>
                    </tr>
                    <tr>
                        <td colspan="10">{!! $customer['swt'] !!}</td>
                    </tr>
                </table>
            </div>
        @endforeach
    @else
        <div>暂无记录</div>
    @endif
@stop
